package cn.stylefeng.guns.modular.gridsystem.config;

import cn.stylefeng.guns.modular.gridsystem.netty.entity.RealTime;
import cn.stylefeng.guns.modular.gridsystem.netty.ws.WsServer;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ssy
 * @date 2023/3/27 10:52
 */
@ConfigurationProperties("ws.server")
@Configuration
@Data
public class WsServerConfig {

    private boolean enable;

    private int port;

    @Bean
    public WsServer wsServer() {
        return new WsServer();
    }

    @Bean
    public RealTime realTime(){
        return RealTime.getInstance();
    }

}

